Skip to content

Conversation

@pchickey
Copy link
Contributor

@pchickey pchickey commented Nov 19, 2024

Rather than put the work into a case-insensitive map for header names and values, lets just reuse the perfectly good one from the http crate. Closes #9

Swap out url::Url for http::uri::Uri as well.

And then, once again no real reason to maintain a local definition of Method, so lets re-export http::Method.

Finally, add headers(&self) -> &HeaderMap and headers_mut(&mut self) -> &mut HeaderMap to Request, just like the one on Response. Closes #11

same authors, slightly different interfaces
…ttp crate

and get rid of the aliases. this crate doesnt even expose trailers, when we do it can
just be a method called trailers(&self) -> &HeaderMap, no big deal.
and propogate some errors out instead of unwrapping
@pchickey pchickey merged commit a09ebd4 into main Nov 20, 2024
4 checks passed
@pchickey pchickey deleted the pch/reuse_http_fields_impls branch December 18, 2024 20:39
sunfishcode added a commit to sunfishcode/wstd that referenced this pull request Jan 2, 2025
Since as of bytecodealliance#19, wstd is using the http crate's types for `HeaderMap`,
`Method`, and `Uri`, switch it to use the http crate's types for `Request`,
`Response`, and `StatusCode` too. These types have a few more features,
and this change makes wstd more interoperable with code that uses the http
crate.

This also helps with bytecodealliance#34, as the new `Request` and `Response` types here
are independent of being incoming or outgoing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http: Request needs headers and headers_mut accessors http: FieldName getter is case sensitive

2 participants